<include file="Base/header" />
<div class="page-container">
	<include file="Base/menu" />
	<div class="page-content">
		<div class="container-fluid">
			<div class="row-fluid">
					<div class="span12">
						<!-- BEGIN PAGE TITLE & BREADCRUMB-->
						<h3 class="page-title">
						</h3>
						<ul class="breadcrumb">
							<li>
								<i class="icon-home"></i>
								<a href="/index.php/Admin/">首页</a>
								<i class="icon-angle-right"></i>
							</li>
							<li><a href="/index.php/Admin/Company">会员管理</a></li>
						</ul>
						<!-- END PAGE TITLE & BREADCRUMB-->
					</div>
			</div>
			<div class="row-fluid">
					<div class="span12">
						<!-- BEGIN EXAMPLE TABLE PORTLET-->
						<div class="portlet box blue">
							<div class="portlet-title">
								<div class="caption"><i class="icon-globe"></i>提现审核</div>
								<div class="tools">
									<a href="javascript:;" class="collapse"></a>
									<a href="javascript:;" class="reload"></a>
									<a href="javascript:;" class="remove"></a>
								</div>
							</div>
							<div class="portlet-body">
								<!-- <div class="clearfix">
									<div class="btn-group">
										<a href="__CONTROLLER__/Add"><button id="sample_editable_1_new" class="btn green">
										新增会员&nbsp;&nbsp;<i class="icon-plus"></i>
										</button></a>
									</div>
								</div> -->
								<div id="sample_1_wrapper" class="dataTables_wrapper form-inline" role="grid">
                                    
									<div class="row-fluid">
                                    <form method="get" action="__URL__/money" >
										<div class="span4">
                                            <div id="sample_1_length" class="dataTables_length">
                                                <select size="1" id="mySelect" name="page_size" aria-controls="sample_1" class="m-wrap small" onchange="submit(this.value)">
                                                    <option id="page10" value="10">10</option>
                                                    <option id="page20" value="20">20</option>
                                                    <option id="page50" value="50">50</option>
                                                    <option id="page100" value="100">100</option>
                                                </select> 条/每页</label>
                                            </div>
                                        </div>
                                        <div class="span4">
                                            <div id="sample_1_length" class="dataTables_length">
                                                <select name="status" class="m-wrap small" onchange="submit(this.value)">
                                                    <option id="page10" value="0">请选择</option>
                                                    <option id="page20" value="1">已处理</option>
                                                    <option id="page20" value="2">未处理</option>
                                                    
                                                </select> 条/每页</label>
                                            </div>
                                        </div>
										<div class="span4">
                                            <div class="dataTables_filter" id="sample_1_filter">
                                                <label><input placeholder="输入要搜索的用户名称" value="{$search}" name="payname" type="text" aria-controls="sample_1" class="m-wrap medium">&nbsp;<input type="submit" aria-controls="sample_1" class="btn blue" value="搜索"></label>
                                            </div>
										</div>
                                    </form>
                                    </div>
<table class="table table-striped table-bordered table-hover dataTable"
id="sample_1" aria-describedby="sample_1_info">
    <thead>
        <tr role="row">
            <th style="width: 24px;" class="sorting_disabled" role="columnheader">
                选择
            </th>
            <th role="columnheader" tabindex="0" aria-controls="sample_1" style="width: 50px;">
                ID
            </th>
            <th class="hidden-480 sorting_disabled" role="columnheader" rowspan="1"
            colspan="1" aria-label="Email" style="width: 150px;">
                openid
            </th>
            <th class="hidden-480 sorting" role="columnheader" tabindex="0" aria-controls="sample_1"
            rowspan="1" colspan="1" aria-label="" style="width: 40px;">
                用户名
            </th>
            <th class="hidden-480 sorting" role="columnheader" tabindex="0" aria-controls="sample_1"
            rowspan="1" colspan="1" aria-label="" style="width: 40px;">
                联系电话
            </th>
            <th class="hidden-480 sorting" role="columnheader" tabindex="0" aria-controls="sample_1"
            rowspan="1" colspan="1" aria-label="" style="width: 40px;">
                提现时间
            </th>
            <th class="hidden-480 sorting" role="columnheader" tabindex="0" aria-controls="sample_1"
            rowspan="1" colspan="1" aria-label="" style="width: 40px;">
                状态
            </th>
            <th class="hidden-480 sorting" role="columnheader" tabindex="0" aria-controls="sample_1"
            rowspan="1" colspan="1" aria-label="" style="width: 40px;">
                金额
            </th>



            <th class="hidden-480 sorting_disabled" role="columnheader" rowspan="1"
            colspan="1" aria-label="Joined" style="width: 20px;">
                管理
             </th>

        </tr>
    </thead>

    <foreach name="data" item="vo">

    <tbody role="alert" aria-live="polite" aria-relevant="all">
     <tr class="gradeX odd">
            <td class="" style="text-align: center;">
                <input type="checkbox" class="massPass" style="width: 18px;height: 18px; color: #000;" value="{$vo.id}" <if condition="$vo['status'] neq 0">disabled="disabled"</if>>
            </td>
            <td class=" ">
                {$vo.id}
            </td>
            <td class="hidden-480 ">
                <!-- <a href="__CONTROLLER__/Updata?id={$vo.id}"> -->
                   {$vo.openid}
                <!-- </a> -->
            </td>
            <td class="hidden-480 ">
                {$vo.payname}
                <!-- <if condition='$vo.sex eq 0'>男<else />女</if> -->
            </td>
            <td class="hidden-480 ">
                {$vo.alipay}
            </td>

            <td class="hidden-480 ">
                 {$vo.add_time|date="Y-m-d",###}

            </td>
            <td class="center hidden-480 ">
                {$vo.statusn}
            </td>
            <td class="center hidden-480 ">
                {$vo.money}
            </td>
            <td class="center hidden-480 ">
                <if condition='$vo.status eq 0'>
                    <a href="__CONTROLLER__/ispass?id={$vo.id}&ispass=1">
                       通过
                    </a> |
                    <a href="__CONTROLLER__/ispass?id={$vo.id}&ispass=2">
                       驳回
                    </a>
                <else />
                    已审核
                </if>
            </td>
        </tr>
    </tbody>


    </foreach>
</table>
<input type="button" name="massdeal" value="批量通过" onclick="massPass()" class="btn blue">
&emsp;
<input type="button" name="" value="批量驳回" onclick="massBack()" class="btn blue">
<script src="__PUBLIC__/plugins/layer/layer.min.js"></script>
<script type="text/javascript">
function massPass(){

    var chk_value = [];
        $('.massPass').each(function(){
            if($(this).attr('checked') == 'checked'){
                chk_value.push($(this).val()); 
            }
        }
        );
        if(chk_value.length == 0){
            layer.alert('选择为空，请先选择');
            return false;
        }

    layer.alert('确定通过？',function(close){
        
        var url = "__CONTROLLER__/mass_pass";
        var postData = {'ids' : JSON.stringify(chk_value),'type':1};
        $.post(url,postData,function(result){
            console.log(result);
            if(result.status == 0){
                layer.alert(result.msg);
                return false;
            }else{
                layer.alert('成功');
                window.location.reload();
                return true;
            }
        },"JSON");
        layer.close(close);
    })
    

}

function massBack(type){
    var chk_value = [];
    $('.massPass').each(function(){
        if($(this).attr('checked') == 'checked'){
            chk_value.push($(this).val()); 
        }
    }
    );
    if(chk_value.length == 0){
        layer.alert('选择为空，请先选择');
        return false;
    }

    layer.alert('确定驳回？',function(close){
        var url = "__CONTROLLER__/mass_pass";
        var postData = {'ids' : JSON.stringify(chk_value),'type':2};
        $.post(url,postData,function(result){
             console.log(result);
            if(result.status == 0){
                layer.alert(result.msg);
                layer.close(close);
                return false;
            }else{
                layer.alert('成功');
                window.location.reload();
                return true;
            }
        },"JSON");
    })

}

</script>
<div class="row-fluid">

    <div class="span6">
        <div class="dataTables_info" id="sample_1_info">
          共{$count}条数据记录。
        </div>
    </div>
    <div class="span6">
        <div class="dataTables_paginate paging_bootstrap pagination">
            {$page}
        </div>
    </div>
</div>
								</div>
							</div>
						</div>
						<!-- END EXAMPLE TABLE PORTLET-->
					</div>
				</div>
		</div>
	</div>
</div>
<include file="Base/footer" />
<script language="javascript" type="text/javascript">
function submit(){
    $.ajax({
        type:"get",
        url:"index?page_size",
        async:false,
    })
}
element=document.getElementById('page'+{$Think.session.page_size});
element.setAttribute("selected","selected");
</script>